<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     */
    protected function schedule(Schedule $schedule): void
    {
        // $schedule->command('inspire')->hourly();

        $schedule->command('command:GoodsWarning')->dailyAt('00:05');//库存预警自动生成
        $schedule->command('command:GetStoreRenewalLog')->everyTenMinutes();//门店续费自动生成
        $schedule->command('command:MoneyLog')->monthlyOn(1, '00:15');//生成日记账汇总
        $schedule->command('command:FinancialProfit')->dailyAt( '01:00')->evenInMaintenanceMode();;//生成利润表
        $schedule->command('command:CheckoutLiabilitiesDay')->dailyAt('00:25');//资产负债表
        $schedule->command('command:CheckoutLiabilitiesYear')->yearly();//资产负债表每年
        $schedule->command('command:CopyGoodsStockList')->dailyAt('23:58');//备份商品库存
        $schedule->command('command:CopySendGoodsStock')->dailyAt('23:55');//备份赠品库存
        $schedule->command('command:GetBirthdayMemberList')->dailyAt('00:30');//生日
        $schedule->command('command:GetReturnVisitMemberList')->dailyAt('00:35');//回访
        $schedule->command('command:GetFestivalMemberList')->dailyAt('00:40');//节日

        // 运维端定时任务
        $schedule->command('command:AdminMoneyLog')->monthlyOn(1, '00:15');//生成日记账汇总
    }

    /**
     * Register the commands for the application.
     */
    protected function commands(): void
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
